<?php require_once('../connections/con_gl.php'); ?>
<?php
$bar = $_GET['barang'];
$kid = $_GET['kid'];
$jum = intval($_GET['jumlah']);
$diskon = intval($_GET['diskon']);
$ppn = intval($_GET['ppn']);
$pph = intval($_GET['pph']);
//$pph = intval($_GET['pph']);
$uangmuka = intval($_GET['uangmuka']);
// get kendaraan
mysql_select_db($database_con_gl, $con_gl);
$query_harga = "select a.hargasewa, a.supir, a.bbm, a.tol, a.parkir, a.akomod, a.other from gl_jenbar as a inner join gl_tipekendaraan as b on (a.jenis = b.id) inner join gl_masterkendaraan as c on (b.id = c.tipekendaraan) where a.barang='$bar' AND c.nopolisi='$kid'"; //echo $query_harga;

$harga       = mysql_query($query_harga, $con_gl) or die(mysql_error());
list($hargasewa, $supir, $bbm, $tol, $parkir, $akomod, $other)   = mysql_fetch_row($harga);
$diskonval = $hargasewa * ($diskon/100);
$afterdiskon = $hargasewa - $diskonval;
$ppnval = $hargasewa * ($ppn/100);
$pphval = $hargasewa * ($pph/100);
//$pphval = $hargasewa * ($pph/100);
$totalbiaya = $supir + $bbm + $tol + $parkir + $akomod + $other;
$grandtotal =  $afterdiskon + $ppnval + $totalbiaya - $pphval;
//$afterdiskon + $ppnval + $totalbiaya - $uangmuka;
?>
<input name="ntotal" type="text" id="ntotal" value="<?php echo $grandtotal; ?>" size="20" maxlength="10" onfocus="javascript: this.blur();" style="text-align:right;" />